import request from '@/config/axios'

// 项目列表 VO
export interface JkProjectVO {
  id: number // id
  name: string // 项目名称
  areaId: number // 区域id
  projectType: number // 项目类型
  projectId: number // 项目id
  concatName: string // 联系人
  concatPhone: string // 联系电话
  address: string // 地址
}

// 项目列表 API
export const JkProjectApi = {
  // 查询项目列表分页
  getJkProjectPage: async (params: any) => {
    return await request.get({ url: `/jikong/jk-project/page`, params })
  },

  getJkProjectSimpleList: async (params: any) => {
    return await request.get({ url: `/jikong/jk-project/simple-list`, params })
  },

  // 查询项目列表详情
  getJkProject: async (id: number) => {
    return await request.get({ url: `/jikong/jk-project/get?id=` + id })
  },

  // 新增项目列表
  createJkProject: async (data: JkProjectVO) => {
    return await request.post({ url: `/jikong/jk-project/create`, data })
  },

  // 修改项目列表
  updateJkProject: async (data: JkProjectVO) => {
    return await request.put({ url: `/jikong/jk-project/update`, data })
  },

  // 删除项目列表
  deleteJkProject: async (id: number) => {
    return await request.delete({ url: `/jikong/jk-project/delete?id=` + id })
  },

  // 导出项目列表 Excel
  exportJkProject: async (params) => {
    return await request.download({ url: `/jikong/jk-project/export-excel`, params })
  }
}
